﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using CsToYjk;
using RevitData;
using DataFuncApplication;

namespace ConsoleApp3
{
    class jlqtest
    {
        static void Main(string[] args)
        {
            //标准层
            Mdl_StdFlr StdFlr1 = DataFunc.StdFlr_Generate(3000,12,3);
            //墙定义
            Mdl_WallSect defwall = DataFunc.WallSect_Def(6,1,200);
            //墙洞定义
            Mdl_WallHoleDef defwallhole = DataFunc.WallHoleDef(900,2500);
            //剪力墙布置,墙洞布置
            var originpos = new List<List<int>>();
            originpos.Add(new List<int> { 0, 0 });
            originpos.Add(new List<int> { 7000, 8000 });
            originpos.Add(new List<int> { 10500, -8000 });
            originpos.Add(new List<int> { 28000, 0 });
            originpos.Add(new List<int> { 21000, 8000 });
            originpos.Add(new List<int> { 17500, -8000 });
            foreach (var node in originpos)
            {
                var xspans = new List<int> { node[0], 3500, 3500 };
                var yspans = new List<int> { node[1], 3000, 5000 };
                var nodelist = DataFunc.node_generate(xspans, yspans, StdFlr1);
                var gridlist = DataFunc.grid_generate(nodelist,1,1);
                DataFunc.wall_arrange(gridlist, defwall);
                DataFunc.wallhole_arrange(gridlist, defwallhole);
            }
            originpos.Clear();
            originpos.Add(new List<int> { 7000, 0 });
            originpos.Add(new List<int> { 17500, 0 });

            foreach (var node in originpos)
            {
                var xspans = new List<int> { node[0], 3500, 3500, 3500 };
                var yspans = new List<int> { node[1], 8000 };
                var nodelist = DataFunc.node_generate(xspans, yspans, StdFlr1);
                var gridlist = DataFunc.grid_generate(nodelist, 1, 1);
                DataFunc.wall_arrange(gridlist, defwall);
                DataFunc.wallhole_arrange(gridlist, defwallhole);
            }
            //标准层复制
            DataFunc.bzc_copy(0, StdFlr1, 18, 3000);
            //提交建模数据
            DataFunc.DbModel_Assign();
            Hi_AddProjectToYjk my = new Hi_AddProjectToYjk(DataFunc.model);
            bool isok = my.CreateYDB("C:\\Users\\10497\\Desktop\\ConsoleApp\\ConsoleApp3");
            if (isok) Console.WriteLine("运行完成！");
            Console.ReadLine();
        }
    }
}
